import { createI18n } from 'vue-i18n'
import en from './en'
import zh from './zh'
const settings = JSON.parse(localStorage.getItem('settings')) || {}
const assetsEn = {}
Object.keys(zh).forEach(key => {
  assetsEn[key] = key
})

const i18n = createI18n({
  legacy: false,
  globalInjection: true,
  locale: settings.language || 'zh-CN',
  messages: {
    'zh-CN': zh,
    'en-US': {
      ...assetsEn,
      ...en,
    },
  },
})
console.log(i18n, 878)

export default i18n
